//
//  YIem_FindDetailViewModel.m
//  B段_开眼
//
//  Created by YIem on 16/4/25.
//  Copyright © 2016年 Howie. All rights reserved.
//

#import "YIem_FindDetailViewModel.h"

@implementation YIem_FindDetailViewModel
+ (void)getDataWithPage:(NSString *)nextPage andUpdate:(BOOL)isUpdate andBlock:(void (^)(NSMutableArray *, NSString *, NSString *))tableArr
{
    
    NSMutableArray *array = [NSMutableArray array];
    
    [CustomerNetWorking connectWithURL:nextPage andUpdate:isUpdate andBlock:^(id response) {
        
        for (NSDictionary *dic in [response objectForKey:@"itemList"] ) {

                
            
            EveryCellModel *model = [[EveryCellModel alloc] init];
            
            [model setValuesForKeysWithDictionary:[dic objectForKey:@"data"]];
            
            [array addObject:model];
                
            
        }
        
        tableArr(array, [response objectForKey:@"nextPageUrl"], [response objectForKey:@"total"]);
    
    }];
    
}

@end
